/**
 * Copyright (c) [2025] [AGIROS] 
 * [travoddsgen] is licensed under Mulan PSL v2. 
 * You can use this software according to the terms and conditions of the Mulan PSL v2. 
 * You may obtain a copy of Mulan PSL v2 at: 
 *          http://license.coscl.org.cn/MulanPSL2 
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, 
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, 
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 
 * See the Mulan PSL v2 for more details.
 */ 

#ifndef filegenvisitor_h__
#define filegenvisitor_h__

#include "DefaultVisitor.h"

class FileGenVisitor : public DefaultVisitor {
public:
    FileGenVisitor(const std::string& outputDir, const std::string& fileName);
    const std::string& getFileName() const;
    std::string& getContent() { return content_; }
protected:
    /**
     * @brief 根据级别计算当前的缩进字符串。
     * 
     * @return 缩进字符串。
     */
    std::string indent();

    /** 
     * @brief 将内容写入文件。
     */
    void writeToFile();
protected:
    /** @brief 缩进。 */
    std::string indent_;
    /** @brief 缩进级别。 */
    unsigned int indentLevel_;
    /** @brief 输出目录。 */
    std::string outputPath_;
    /** @brief 输出文件名。 */
    std::string fileName_;
    /** @brief 输出内容。 */
    std::string content_;
};

#endif // filegenvisitor_h__